/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package auctions;
import java.text.DecimalFormat;

/**
 *
 * @author hang
 */
public class ConvertType {
    public static String strPre(double inValue){
        DecimalFormat threeDec = new DecimalFormat("0.000");
        String shortString = (threeDec.format(inValue));
        return shortString;
    }
    public static boolean[] intToBinaryArr(int val, int digits) {
        boolean[] result=new boolean[digits];
        String str = Integer.toBinaryString(val);
        while(str.length()<digits)
            str = "0"+str;
        for(int i=0; i<digits; i++) {
            if(str.charAt(i)=='0')
                result[i]=false;
            else
                result[i]=true;
        }
        return result;
    }
}
